# -*- utf-8 -*-
# author : li shi jie
# Email : yr785339493@qq.com

# 二分查找
def binary_search(li, val):
    left = 0
    right = len(li)-1
    while left <= right:
        mid = int((left+right) / 2)
        if li[mid] > val:
            right = mid - 1
        elif li[mid] == val:
            return mid
        else:
            left = mid + 1

li = [2,7,10,5,6,98]

print(li[::3])
# res = binary_search(li, 98)
# print(res)

# 冒泡排序
# def bubble_sort(li):
#     for i in range(len(li)-1):
#         exchange = False
#         for j in range(len(li)-i-1):
#             if li[j] > li[j+1]:
#                 li[j], li[j+1] = li[j+1], li[j]
#                 exchange = True
#         print(li)
#         if not exchange:
#             return

# bubble_sort(li)
# print(li)
# def select_sort(li):
#     for i in range(len(li)-1):
#         min_loc = i
#         for j in range(i+1, len(li)):
#             if li[j] < li[min_loc]:
#                 min_loc = j
#         if min_loc != i:
#             li[min_loc], li[i] = li[i], li[min_loc]

def bubble_search(li, val):
    left = 0
    right = len(li)-1
    while left <= right:
        mid = (left + right) / 2
        if li[mid] > val:
            right = mid - 1
        elif li[mid] == val:
            return mid
        else:
            left = mid + 1





form_data = {
            'items': '&qdn=003370201&p=1',
            'all': '0',
            'category': '1'
                            }

form_data['items'] = 2
form_data['items'] = 3
print(form_data)




